/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.erpworld.hr.dao;

import java.util.List;
import org.hibernate.HibernateException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author volkan
 */
public class HrpersonelDAO extends HibernateDAO {
    private final Logger log=LoggerFactory.getLogger(HrpersonelDAO.class);
    private static final String ALL_PERSONEL_BY_ID="from Hrpersonel p order by p.personelId";
    
        public List<Hrpersonel> list() {
        log.info("Tüm Personeller getiriliyor...");
        try {
            getSession().getTransaction().begin();
            List personels = getSession().createQuery(ALL_PERSONEL_BY_ID).list();
            getSession().getTransaction().commit();
            return personels;
        } catch (HibernateException e) {
            log.error("Bütün Personelleri  getirme sırasında hata oluştu.", e);
            throw e;
        }
    }
}
